package com.turnengine.client.global.admin.command;

import com.javabi.command.IExecutableCommand;
import com.javabi.command.IExecutableCommandResponse;
import com.javabi.command.serializer.AbstractCommandDataSerializer;
import com.javabi.common.io.data.IDataReader;
import com.javabi.common.io.data.IDataWriter;
import java.io.IOException;

/**
 * The Ping Data Serializer.
 */
public class PingDataSerializer extends AbstractCommandDataSerializer<Boolean> implements IPingDataSerializer {

	/**
	 * Creates a new Ping Data Serializer.
	 */
	public PingDataSerializer() {
		super(Ping.COMMAND_ID);
	}

	@Override
	public Boolean readReturnValue(IDataReader reader) throws IOException {
		Boolean value = reader.readBooleanObject(true);
		return value;
	}

	@Override
	public void writeReturnValue(IDataWriter writer, Boolean value) throws IOException {
		writer.writeBooleanObject(value, true);
	}

	@Override
	public IExecutableCommand<Boolean> readRequest(IDataReader reader) throws IOException {

		// Read fields

		// Create object
		Ping object = new Ping();
		return object;
	}

	@Override
	public void writeRequest(IDataWriter writer, IExecutableCommand<Boolean> argument) throws IOException {
		Ping object = (Ping) argument;

		// Get fields

		// Write fields
	}

	@Override
	public IExecutableCommandResponse<Boolean> newResponse() {
		return new PingResponse();
	}
}
